package com.ruoyi.system.domain;

import java.math.BigDecimal;

import com.ruoyi.common.annotation.Add;
import com.ruoyi.common.annotation.Edit;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import javax.validation.constraints.*;

/**
 * building对象 community_building
 * 
 * @author hanpee
 * @date 2024-03-22
 */
public class CommunityBuilding extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键(自增) */
    private Long id;
    /** 楼宇名称 */
    @Excel(name = "楼宇名称")
    @NotBlank(message = "楼宇名称不能为空", groups = {Add.class, Edit.class})
    private String name;

    /** 层数 */
    @Excel(name = "层数")
    @NotNull(message = "楼层数不能为空", groups = {Add.class, Edit.class})
    private Long piles;

    /** 高度 */
    @Excel(name = "高度")
    @NotNull(message = "高度不能为空", groups = {Add.class, Edit.class})
    @Min(value = 1, message = "高度必须大于等于1", groups = {Edit.class})
    private Long height;

    /** 占地面积 */
    @Excel(name = "占地面积")
    @NotNull(message = "占地面积不能为空", groups = {Add.class, Edit.class})
    @Digits(integer = 10, fraction = 2, message = "请输入有效的数值", groups = {Edit.class}) //确保最多10位整数2位小数数值
    @DecimalMin(value = "0.01", message = "占地面积必须大于等于0.01", groups = {Add.class, Edit.class})
    private BigDecimal area;

    /** 删除标记，0为删除，1已删除 */
    private String delFlag;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setName(String name) 
    {
        this.name = name;
    }

    public String getName() 
    {
        return name;
    }
    public void setPiles(Long piles) 
    {
        this.piles = piles;
    }

    public Long getPiles() 
    {
        return piles;
    }
    public void setHeight(Long height) 
    {
        this.height = height;
    }

    public Long getHeight() 
    {
        return height;
    }
    public void setArea(BigDecimal area) 
    {
        this.area = area;
    }

    public BigDecimal getArea() 
    {
        return area;
    }
    public void setDelFlag(String delFlag) 
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag() 
    {
        return delFlag;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("name", getName())
            .append("piles", getPiles())
            .append("height", getHeight())
            .append("area", getArea())
            .append("createTime", getCreateTime())
            .append("remark", getRemark())
            .append("updateTime", getUpdateTime())
            .append("delFlag", getDelFlag())
            .toString();
    }
}
